package com.biz.primus.model.member.enums;

import com.biz.primus.common.enums.EnumerableValue;
import com.biz.primus.common.enums.converter.BaseEnumValueConverter;

/**
 * 类说明：会员权属类型枚举
 *
 * @author jun.liu
 */
public enum OwnershipTypes implements EnumerableValue
{

    personal(1, "个人"),
    company(2, "公司");

    public static class Converter extends BaseEnumValueConverter<OwnershipTypes>
    {
    }

    private int value;
    private String desc;

    private OwnershipTypes(int value, String desc)
    {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static OwnershipTypes getMemberTypeByValue(int codeVal)
    {
        for (OwnershipTypes memberType : OwnershipTypes.values())
        {
            if (memberType.getValue() == codeVal)
            {
                return memberType;
            }
        }
        return null;
    }


}
